Here, I want to simulate scRNA-seq data from trajctories to benchmark performance of velocity based visualization.

Setup and get data from scVelo

Dynverse demo - not sure why this doesn’t work

Different dynverse demo

Create multifurcating trajectory

## [1] "finding approximate nearest neighbors ..."
## [1] "calculating clustering ..."
## [1] "graph modularity: 0.683635778301471"
## [1] "identifying cluster membership ..."
## com
##   1   2   3   4   5 
## 154 197 246 196 207

Assign pseudotime to cells

Order cells wrt to pseudotime - subset 1 –> observed, subset 2 (at later pseudtime points) –> projected

## [1] "Done finding neighbors"
## [1] "Done making graph"

Try fdg on observed

Try removing subsets and compare velocity fdg vs observed fdg

## [1] "Done finding neighbors"
## [1] "Done making graph"

Now look at graph made from just observed

Try one of dynverses premade toy trajectories

#####Scratch

Splatter demo

Use the reticulate package to use scVelo from within R:

Compute velocities on pancreas data using velocyto

Extract spliced and unspliced data

Extract PCA coordinates

Filter genes

Downsample cells to make things easier

Normalize for dimensional reduction

Dimensional reduction

Run velocyto on panc data

Graph visualization

Scores of observed and projected states in PC space

Graph visualization on subset of cells from PC coordinates

Removing intermediate cell types

First, we’ll see if removing Ngn3 low EP cell types affects the visualization. Given that there are only relatively few of these cells, I suspect that the effect won’t be noticeable in the visualization.

As expected, the visualization doesn’t change very much by removing Ngn3 low EP cells. Next, let’s see the effect of removing Ngn3 high EP or Pre-endocrine cells.
First, remove pre-endocrine cells..

…and now Ngn3 high EP

Let’s try removing multiple subsets, Ngn3 highEP and Pre-endocrine

Removing terminal cell types

Remove a proportion of cells from one of the terminal cell types..